package person

import (
	"fmt"
	"strconv"
)

/*
	golang中struct不需要注明实现了interface
*/

type Student struct {
	Age int
}

func (this Student) Die(age int) string {
	this.Age = age
	/*
	  golang没有java方便的地方：string只能+string
	*/
	return "This student died at the age of " + strconv.Itoa(age)
}
func (this Student) String() string {
	return "6"
}

type Teacher struct {
	Age int
}

func (this Teacher) Die(age int) string {
	this.Age = age
	return fmt.Sprintf("This teacher died at the age of %d", age)
}
